package com.wangxin.study8.completablefuture;

import java.util.concurrent.CompletableFuture;

/**
 * @ClassName SupplyAsyncTest
 * @Description 有返回值
 * @Author Wangxin
 * @Date 2019-03-24 18:39
 * @Version 1.0
 **/
public class SupplyAsyncTest {
    public static void main(String[] args) throws Exception{
        CompletableFuture<Long> future = CompletableFuture.supplyAsync(()->{
            try {
                Thread.sleep(100);
            }catch (Exception e){
                e.printStackTrace();
            }
            System.out.println("end…………");
            return System.currentTimeMillis();
        });
        System.out.println(future.get());
    }
}
